﻿CREATE TABLE [dbo].[Alerts] (
    [Id]           UNIQUEIDENTIFIER DEFAULT (newid()) NOT NULL,
    [Title]        NVARCHAR (50)    NOT NULL,
    [Description]  NVARCHAR (MAX)   NOT NULL,
    [IconType]     INT              NOT NULL,
    [CreationDate] DATETIME         NOT NULL,
    [CreatedBy]    UNIQUEIDENTIFIER NULL,
    [Geoposition]  NVARCHAR (40)    NULL,
    [AlertType]    INT              NULL,
    [CreatedByApp] UNIQUEIDENTIFIER NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC),
    FOREIGN KEY ([CreatedByApp]) REFERENCES [dbo].[Apps] ([Id]),
    CONSTRAINT [FK_Alerts_0] FOREIGN KEY ([CreatedBy]) REFERENCES [dbo].[UsersAuthentication] ([Id])
);

